#! /bin/sh --posix

xrdb -merge ~/.Xresources

killall shadow
killall input_lemonbar
killall lemonbar
killall xcompmgr

sleep 1

ALLMONITORLENGTH=`xrandr | grep "*" | sed -e 's/x.*$//g' | paste -sd+ - | bc`

input_lemonbar -c0 "#161712" -c1 "#e2e1cf" -c2 "#c7c4b1" -c3 "#6e6f67" -c4 "#282b25" -c5 "#868377" -c6 "#cc7777" | lemonbar -b -g "$ALLMONITORLENGTH"x12 -d -f "-lucy-tewii-medium-r-normal--11-90-100-100-c-60-iso10646-1" -f "-*-terminus-*-*-*-*-*-*-*-*-*-*-*-*" -p -a 32 | mksh &


mode_fast ()
{
	hsetroot -solid \#352f2f -tile "$HOME/.config/desktop/wallpaper"
}

mode_fancy ()
{
	mode_fast
	cd ~/bin/git/shadow
#	poetry run ./shadow -o 0.5 -m root -f 30 -q 0.3 ---qualitymode pixelize ./glsl/compressed_sin.glsl &
	xcompmgr -c &
}

case "$1" in
	"fast" ) mode_fast ;;
	"fancy" ) mode_fancy & ;;
	*) exit 1 ;;
esac
